<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <div th:insert="commen/head :: header">
    </div>
    <script type="text/javascript">
        window.onload = function () {
            var updateBtn = document.getElementById("updateBtn")
            updateBtn.onclick = function () {
                alert("修改成功");
            }
        }
    </script>
</head>
<body style="background-color: rgb(242,244,247);">
<div th:insert="commen/navigationBar :: topNavBar"></div>
    <div class="container" style="background-color: #ffffff; padding-bottom: 15px; border-radius: 10px">
        <div class="row">
            <div class="col-md-6">
                <h2>我的头像</h2>
                <div>
                    <div th:if="${session.user}">
                        <img th:src="@{'../img/' + ${session.user.userImg}}" alt="" style="width: 90px; height: 90px; border-radius: 100%;">
                    </div>
                    <form th:action="@{/upload}" method="post" enctype="multipart/form-data">
                        头像:<input type="file" name="headerImg"><br>
                        <input class="btn-success btn" type="submit" value="上传">
                    </form>
                </div>
            </div>
            <div class="col-md-6">
                <h2>基本资料</h2>
                <form th:action="@{/updateUser}" method="post">
                    <input type="hidden" name="userId" th:value="${session.user.userId}">
                    姓名:<input class="form-control" type="text" name="userName" th:value="${session.user.userName}"> <br>
                    系部:<input class="form-control" type="text" name="department" th:value="${session.user.department}"> <br>
                    专业:<input class="form-control" type="text" name="major" th:value="${session.user.major}"> <br>
                    班级:<input class="form-control" type="text" name="gradeClass" th:value="${session.user.gradeClass}"> <br>
                    邮箱:<input class="form-control" type="text" name="email" th:value="${session.user.email}"> <br>


                    <input class="btn btn-success" type="submit" id="updateBtn" th:value="修改">
                </form>
            </div>
        </div>
    </div>



</body>
</html>